package com.zhangji.springcloud.service;

import com.zhangji.springcloud.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @Description: 引入Feign的接口
 * @Author: Zhang Ji
 * @Date: 2021/6/27 23:17
 * Created by IntelliJ IDEA.
 */
@Component
@FeignClient(value = "SPRINGCLOUD-PROVIDER-DEPT-8001HAHA",fallbackFactory = DeptClientServerFallback.class)
public interface DeptClientServer {

    @GetMapping("/dept/get/{id}")
    Dept queryById(@PathVariable("id") Long id);

    @GetMapping("/dept/queryAll")
    List<Dept> queryAll();

    @PostMapping("/dept/add")
    boolean addDept(Dept dept);


}
